<template>
  <u-picker
    v-model="show"
    :mode="pickerMode"
    :params="yearPickerParams"
    @confirm="confirmYearPicker"
  ></u-picker>
</template>

<script>
export default {
  watch: {
    ifShowYearPicker(val, old) {
      this.show = val;
    },
  },
  props: {
    ifShowYearPicker: {
      type: Boolean,
    },
    pickerMode: {
      type: String,
    },
    yearPickerParams: {
      type: Object,
    },
  },
  data() {
    return {
      show: false,
      // yearPickerParams: {
      // year: true,
      // month: true,
      // day: true,
      // hour: false,
      // minute: false,
      // second: false,
      // },
    };
  },
  methods: {
    confirmYearPicker(e) {
      console.log(e);
      this.$emit("yearDataFromSon", e.year);
    },
  },
};
</script>

<style lang="scss" scoped>
.common_u_picker {
}
</style>
